//
//  Goal.m
//  tp1-gti350
//
//  Created by Coulon-Hamelin, Alexandre on 13-09-19.
//  Copyright (c) 2013 Coulon-Hamelin, Alexandre. All rights reserved.
//

#import "Goal.h"

@implementation Goal

-(id) initWithTeam:(Team*)team AndPeriod:(int) period AndScorer:(Player*) scorer
{
    self.team = team;
    self.period = period;
    self.scorer = scorer;
    
    return self;
}
-(NSString *) getFormatedString
{
    NSString *listToReturn = [NSString string];
    
    if (self.period == 1 )
    {
        listToReturn = [NSString stringWithFormat:@"%dère période, %@ - But : %@, Aides : %@, %@ ",self.period,self.team.name,self.scorer.lastName,self.pass1.lastName,self.pass2.lastName];
    }
    else
    {
        listToReturn = [NSString stringWithFormat:@"%dème période, %@ - But : %@, Aides : %@, %@ ",self.period,self.team.name,self.scorer.lastName,self.pass1.lastName,self.pass2.lastName];
        
    }
    return listToReturn;
}

@end
